package promote.brozen.algorithm.tree;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author Brozen
 * @date 2019/12/19 8:20 AM
 */
@Getter
@Setter
@EqualsAndHashCode
public class TreeNode<K, S extends TreeNode<K, S>> {

    private TreeNode<K, S> parent;

    protected List<S> children;

    protected K key;

    public TreeNode(K key) {
        this.key = key;
    }

    @Override
    public String toString() {
        return "TreeNode[" + key + "]";
    }
}
